package br.pucrio.inf.aaaong.models.form.errors;

public class FormError {
	private String message;

	private String fieldName;

	public FormError(String message) {
		this(message, null);
	}

	public FormError(String message, String fieldName) {
		this.message = message;
		this.fieldName = fieldName;
	}

	public String getMessage() {
		if (fieldName != null) {
			return fieldName + " " + message;
		} else {
			return message;
		}
	}

}
